package com.richapp.launcher.database.system.dao;

import com.richapp.launcher.database.system.SystemBaseDao;
import com.richapp.launcher.database.system.mode.UserModel;

import android.content.Context;
import android.util.Log;

public class UserModelDao extends SystemBaseDao<UserModel>{

	public UserModelDao(Context context) {
		super(context,UserModel.class);
	}
	
	public UserModel getByName(String userName){
		if(userName == null){
			return null;
		}
		
		UserModel um = null;
		try {
			um = gettOp().queryBuilder().where().eq("userName", userName).queryForFirst();
		} catch (Exception e) {
			Log.e(getClass().getName(), e.getMessage());
		}
		return um;
	}
	
	public UserModel getUserFirst(){
		UserModel um = null;
		try {
			um = gettOp().queryBuilder().queryForFirst();
		} catch (Exception e) {
			Log.e(getClass().getName(), e.getMessage());
		}
		return um;
	}
}
